package org.budo.dubbo.protocol.http.sign;

import java.io.Serializable;
import java.util.Map;

import org.budo.dubbo.protocol.http.Consts;

import com.alibaba.dubbo.common.utils.CollectionUtils;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author lmw
 */
@Getter
@Setter
@ToString
public class SignEntity implements Serializable {
    private static final long serialVersionUID = 604560547901415020L;

    private String appKey;

    private String sign;

    private String time;

    public SignEntity() {}

    public SignEntity(String sign, String appKey, String time) {
        this.setSign(sign);
        this.setAppKey(appKey);
        this.setTime(time);
    }

    public Map<String, Object> toMap() {
        return CollectionUtils.toMap(Consts.HeaderKey.AppKey, this.getAppKey(), //
                Consts.HeaderKey.Time, this.getTime(), //
                Consts.HeaderKey.Sign, this.getSign());
    }
}